package Code.Day9_20240926.com.dx.day09;

import java.util.LinkedList;

/**
 * @ClassName Test01
 * @Description TODO:
 * @Author 12994
 * @Date 2024/9/26 15:36
 * @Version 1.0
 **/
public class Test01 {
    public static void main(String[] args) {
        // 有序可重复数据
        LinkedList<Integer> list = new LinkedList<>();
        list.add(1);
        list.addLast(2);
        list.add(3);
        System.out.println(list.size());
        System.out.println(list.get(0));
        System.out.println("__________");

        list.forEach(System.out::println);
        System.out.println("__________");

        // pop和poll等效
        Integer a = list.pop();
        Integer b = list.poll();
        System.out.println(a);
        System.out.println("__________");
        System.out.println(b);
        System.out.println("__________");

        for (Integer p : list) {
            System.out.println(p);
        }
        System.out.println("__________");

    }
}
